#include <iostream>

class Drink
{
public:
    virtual void Boil() = 0;//烧水
    virtual void Brew() = 0;//冲泡
    virtual void PutSomething() = 0;//加辅料

    //工作流程
    void MakeDrink()
    {
        Boil();
        Brew();
        PutSomething();
    }
};

class Coffee:public Drink
{
public:
    void Boil()
    {
        std::cout<<"烧矿泉水"<<std::endl;
    }
    void Brew()
    {
        std::cout<<"倒咖啡粉"<<std::endl;
    }
    void PutSomething()
    {
        std::cout<<"加入白糖"<<std::endl;
    }
};

class MilkTea:public Drink
{
public:
    void Boil()
    {
        std::cout<<"烧矿泉水"<<std::endl;
    }
    void Brew()
    {
        std::cout<<"倒奶茶粉冲泡"<<std::endl;
    }
    void PutSomething()
    {
        std::cout<<"加入果冻"<<std::endl;
    }
};

int main()
{
    Drink *d = new Coffee;
    d->MakeDrink();
    
    return 0;
}